package com.tencent.iov.cowin.befsale.clue.dao.http.tenant;

import com.tencent.iov.cowin.befsale.clue.dao.http.tenant.request.QueryDictionariesRequest;
import com.tencent.iov.cowin.befsale.clue.dao.http.tenant.response.DictionariesResponse;
import com.tencent.iov.cowin.befsale.clue.value.contants.ServiceConstant;
import com.software.boot.common.entity.Response;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author: whp
 * @description:
 * @createDate: 2021-12-06
 **/

@FeignClient(name = ServiceConstant.SCRM_ACCOUNT_SERVICE,
        url = ServiceConstant.SCRM_ACCOUNT_SERVICE_HOST)
//        url = "http://scrm-dev.scrm-account-service.innet.dm.newcowin.com/") //凯翼环境
public interface TenantClient {
    String TENANT_DICTIONARIES_URL_PREFIX = "/v1/scrm/tenant/dictionaries";

    /**
     * 获取字典信息
     *
     * @param request 参数
     * @return 字典列表数据
     */
    @ApiOperation(value = "Tenant管理-通过types获取字典信息", httpMethod = "GET", response = Response.class, notes = "get_list_by_param")
    @PostMapping(TENANT_DICTIONARIES_URL_PREFIX + "/get_list_by_param")
    Response<List<DictionariesResponse>> getDictionariesListByParam(@RequestBody QueryDictionariesRequest request);

    /**
     * 根据父级节点查询字典数据信息
     *
     * @param parentCode 父字典ID
     * @return 字典信息
     */
    @ApiOperation(value = "Dictionaries管理-根据父级节点查询字典数据信息", httpMethod = "GET", response = Response.class, notes = "get_list_by_parent_id")
    @GetMapping(path = TENANT_DICTIONARIES_URL_PREFIX + "/get_list_by_parent_code")
    Response<List<DictionariesResponse>> getListByParentCode(@RequestParam("parentCode")String parentCode);
}
